package cn.ncupyh.soft;

public class GoodsTest {
    public static void main(String[] args) {
//        创建数组
        Goods[] arr = new Goods[3];

//      创建对象
//      快捷键:ctrl + p   ---显示须填写的参数名称
        Goods g1 = new Goods("001","苹果手机",5555.0,1000);
        Goods g2 = new Goods("002","项链",236.9,110);
        Goods g3 = new Goods("003","枸杞",22.3,30);

//        赋值
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g3;

//        打印
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].getId() + "," +
                    arr[i].getName() + "," +
                    arr[i].getPrice() + "," +
                    arr[i].getRemaining());
        }



    }



}
